cc.Class({
    extends: cc.Component,

    properties: {
        blackPic: cc.SpriteFrame,
        whitePic: cc.SpriteFrame
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {},

    setPic(currentPlayer) {
        if (currentPlayer=='BLACK') {
            this.node.getComponent(cc.Sprite).spriteFrame = this.blackPic;
        }
        else if (currentPlayer=='WHITE') {
            this.node.getComponent(cc.Sprite).spriteFrame = this.whitePic;
        }
    }
});
